﻿using Abp.Application.Services.Dto;
using Castle.MicroKernel.SubSystems.Conversion;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Xml.Linq;

namespace AppFramework.DinosaursParkMes.ProductWork.Dto
{
    public class UpdateProductOrderDto : IEntityDto
    {
        /// <summary>
        /// 主键
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 生产编号
        /// </summary>
        public string Productionnumber { get; set; }
        /// <summary>
        /// 工单编号
        /// </summary>
        public string Workordernumber { get; set; }

        /// <summary>
        /// 工单名称
        /// </summary>
        public string Workordername { get; set; }

        /// <summary>
        /// 关联计划
        /// </summary>
        public string Produceplanname { get; set; }

        /// <summary>
        /// 产品名称
        /// </summary>
        public string Finishedproductname { get; set; }

        /// <summary>
        /// 产品编号
        /// </summary>
        public string Finishedproductcore { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specsmodel { get; set; }

        /// <summary>
        /// 产品类型
        /// </summary>
        public string Finishedproducttype { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 需求日期
        /// </summary>
        public DateTime Demandtime { get; set; }

        /// <summary>
        /// 计划数量
        /// </summary>
        public int Plannum { get; set; }
        /// <summary>
        /// 实际数量
        /// </summary>
        public int Actualnumber { get; set; }

        /// <summary>
        /// 计划开工时间
        /// </summary>
        public DateTime Starttime { get; set; }

        /// <summary>
        /// 计划完工时间
        /// </summary>
        public DateTime Completedtime { get; set; }

        /// <summary>
        /// 实际开工时间
        /// </summary>
        public DateTime Actualoperatingtime { get { return default(DateTime); } set { } }

        /// <summary>
        /// 实际完工时间
        /// </summary>
        public DateTime Actualcompletiontime { get { return default(DateTime); } set { } }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }

    }
    public class FindProduct
    {
        /// <summary>
        /// 生产计划编号
        /// </summary>
        [Display(Name = "生产计划编号")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        public string ExplainNumber { get; set; }
        /// <summary>
        /// 工单编号
        /// </summary>
        [Display(Name = "工单编号")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        public string WorkOrderNumber { get; set; }
        /// <summary>
        /// 工单名称
        /// </summary>
        [Display(Name = "工单名称")]
        [MaxLength(30)]
        [Column(TypeName = "nvarchar(30)")]
        public string WorkOrderName { get; set; }
        /// <summary>
        /// 关联计划
        /// </summary>
        [Display(Name = "关联计划")]
        [MaxLength(30)]
        [Column(TypeName = "nvarchar(30)")]
        public string RelevanceExplain { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        [Display(Name = "产品名称")]
        [MaxLength(30)]
        [Column(TypeName = "nvarchar(30)")]
        public string ProductName { get; set; }
        /// <summary>
        /// 产品编号
        /// </summary>
        [Display(Name = "产品编号")]
        [MaxLength(50)]
        [Column(TypeName = "nvarchar(50)")]
        public string ProductNumber { get; set; }
        /// <summary>
        /// 规格型号
        /// </summary>
        [Display(Name = "规格型号")]
        [MaxLength(40)]
        [Column(TypeName = "nvarchar(40)")]
        public string Specification { get; set; }
        /// <summary>
        /// 产品类型
        /// </summary>
        [Display(Name = "产品类型")]
        [MaxLength(40)]
        [Column(TypeName = "nvarchar(40)")]
        public string ProductType { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        [Display(Name = "单位")]
        [MaxLength(20)]
        [Column(TypeName = "nvarchar(20)")]
        public string Unit { get; set; }
        public string BOMNumber { get; set; }
        public string BOMV { get; set; }
        //public string BomName { get; set; }
        /// <summary>
        /// 物料清单
        /// </summary>
        public List<ProductBillOfMaterialDto> BillOfMaterials { get; set; }
        /// <summary>
        /// 工艺路线编号
        /// </summary>
        public string RoutingNumber { get; set; }
        /// <summary>
        /// 工艺路线名称
        /// </summary>
        public string RoutingName { get; set; }
        public List<PRoductProcessInfoDto> ProcessInfos { get; set; }
        ///// <summary>
        ///// 需求日期
        ///// </summary>
        //[Display(Name = "需求日期")]
        //public DateTime DemandDate { get; set; }
        ///// <summary>
        ///// 计划数量
        ///// </summary>
        //[Display(Name = "计划数量")]
        //[Column(TypeName = "int")]
        //public int ExplainNum { get; set; }
        ///// <summary>
        ///// 需求日期
        ///// </summary>
        //[Display(Name = "计划开工时间")]
        //public DateTime ExplainStartDate { get; set; }
        ///// <summary>
        ///// 需求日期
        ///// </summary>
        //[Display(Name = "计划完工时间")]
        //public DateTime ExplainEndDate { get; set; }
        //public string Remark { get; set; }

    }
    public class ProductBillOfMaterialDto
    {
        public int Id { get; set; }
        /// <summary>
		/// 物料编号
		/// </summary>
		public string Materialnumber { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specificationsversion { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 使用量
        /// </summary>
        public int Usageamount { get; set; }

        /// <summary>
        /// 用料比例
        /// </summary>
        public int Useratio { get; set; }
        
    }
    /// <summary>
    /// 工艺离线
    /// </summary>
    public class PRoductProcessInfoDto
    {
        /// <summary>
        /// 工艺编号
        /// </summary>
        public string Craftcode { get; set; }


        /// <summary>
        /// 工艺名称
        /// </summary>
        public string ProcessName { get; set; }
    }
}
